package com.atguigu.gulimall.ware.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("gulimall-product")
public interface ProductFeignServce {

    /**
     * 请求路径两种写法：
     *  一种是 @FeignClient("gulimall-product") + "/product/skuinfo/info/{skuId}"
     *      表示直接给gulimall-product发请求
     *  一种是@FeignClient("gulimall-gateway")  + "/api/product/skuinfo/info/{skuId}"
     *       给网关发请求
     * @param skuId
     * @return
     */
    @RequestMapping("/product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);
}
